// import './assets/css/base.css'
import './assets/css/font.css'
import './assets/css/iconfont.css'

import { createApp } from 'vue'
import App from './layouts/AppLayout.vue'

// 引入路由
import router from './router'

// 注册全局状态数据
import { setupStore } from './store'

import elementPlus from './lib/plugin/element-ui'

import lazyPlugin from './lib/plugin/vue-lazyload'

import filters from '@/filters'

const app = createApp(App)
app.provide('app', app)

app.use(router)

app.use(setupStore)

app.use(elementPlus)

app.use(lazyPlugin)

filters(app)

window.addEventListener('load', async () => {
  (await import('./lib/plugin/Bus')).install(app);
  // (await import('./lib/plugin/Alert/Alert')).install(app);
  (await import('./lib/plugin/Aegis')).install(app);
  (await import('./lib/plugin/tip')).install(app);
  (await import('./lib/plugin/CSSVar')).install(app)

  app.mount('#app')
})
